'use strict';
// Copyright 2014 Blueant Inc. All Rights Reserved.

/**
 * @fileoverview vip等级
 * @author sundbcn@gmail.com (sun debing)
 */

var moment = require('moment');
var modelUtil = require('../util/modelUtil');
var constantUtil = require('../util/constantUtil');
var mongoConnector = require('../libs/mongodb/mongoConnector');
/* jshint unused:false */
var dailyEnergySchema = require('../schemas/dailyEnergySchema.js');
var DailyEnergy = mongoConnector().model('DailyEnergy');

/**
 * 根据role_id获取model
 * @return {[type]} [description]
 */
module.exports.getByRoleId = function (role_id, cb) {
    modelUtil.getByRoleId(DailyEnergy, role_id, function (err, daily_energy_model) {
        if (!!err) {
            console.error(err);
            return cb(err);
        }
        cb(null, daily_energy_model);
    });
};

/**
 * 5点刷新
 */
module.exports.onFiveRefresh = function (self, cb) {
    self.refresh();
    cb();
};
